USE [QLDL]
GO

/****** Object:  Table [dbo].[CT_PHIEUXUATHANG]    Script Date: 01/03/2011 15:19:04 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[CT_PHIEUXUATHANG](
	[MaCT] [nvarchar](10) NOT NULL,
	[MaPhieuXuat] [nvarchar](10) NULL,
	[MaMatHang] [nvarchar](10) NULL,
	[SoLuong] [int] NULL,
	[DonGiaXuat] [money] NULL,
	[ThanhTien] [money] NULL,
 CONSTRAINT [PK_CT_PHIEUXUATHANG] PRIMARY KEY CLUSTERED 
(
	[MaCT] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[CT_PHIEUXUATHANG]  WITH CHECK ADD  CONSTRAINT [FK_CT_PHIEUXUATHANG_MaMatHang] FOREIGN KEY([MaMatHang])
REFERENCES [dbo].[MATHANG] ([MaMatHang])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[CT_PHIEUXUATHANG] CHECK CONSTRAINT [FK_CT_PHIEUXUATHANG_MaMatHang]
GO

ALTER TABLE [dbo].[CT_PHIEUXUATHANG]  WITH CHECK ADD  CONSTRAINT [FK_CT_PHIEUXUATHANG_MaPhieuXuat] FOREIGN KEY([MaPhieuXuat])
REFERENCES [dbo].[PHIEUXUATHANG] ([MaPhieuXuat])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[CT_PHIEUXUATHANG] CHECK CONSTRAINT [FK_CT_PHIEUXUATHANG_MaPhieuXuat]
GO


